/*
 * @Date: 2022-05-21 09:03:07
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-05-21 09:07:37
 * @FilePath: \my-react-components\src\component\Icon\index.tsx
 * @Description: Icon
 */
import React, { memo } from "react";
import classNames from "classnames";
import {
  FontAwesomeIcon,
  FontAwesomeIconProps,
} from "@fortawesome/react-fontawesome";
export type ThemeProps =
  | "primary"
  | "secondary"
  | "success"
  | "info"
  | "warning"
  | "danger"
  | "light"
  | "dark";
export interface IconProps extends FontAwesomeIconProps {
  theme?: ThemeProps;
}
const Icon: React.FC<IconProps> = memo(({ className, theme, ...restProps }) => {
  const classes = classNames("sailor-icon", className, {
    [`icon-${theme}`]: theme,
  });
  return <FontAwesomeIcon className={classes} {...restProps}></FontAwesomeIcon>;
});

export default Icon;
